package cn.iocoder.yudao.module.project.dal.mysql.electronicscalemanage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.electronicscalemanage.ElectronicScaleManageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.electronicscalemanage.vo.*;

/**
 * 电子秤管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ElectronicScaleManageMapper extends BaseMapperX<ElectronicScaleManageDO> {

    default PageResult<ElectronicScaleManageDO> selectPage(ElectronicScaleManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicScaleManageDO>()
                .eqIfPresent(ElectronicScaleManageDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ElectronicScaleManageDO::getName, reqVO.getName())
                .eqIfPresent(ElectronicScaleManageDO::getIp, reqVO.getIp())
                .eqIfPresent(ElectronicScaleManageDO::getPort, reqVO.getPort())
                .eqIfPresent(ElectronicScaleManageDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ElectronicScaleManageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ElectronicScaleManageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ElectronicScaleManageDO::getId));
    }

}